package com.tianhua.javs.client.utils;

import com.tianhua.javs.client.enums.BusinessKeyWardEnum;
import com.tianhua.javs.client.enums.JavsKeyWardEnum;

/**
 * Description:
 * date: 2022/2/10
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
public class KeyWardUtils {

    /**
     * 判断字符串是否是业务关键字
     * @return
     */
    public static boolean isBusinessKeyWard(String varCode){
        if(varCode.contains("(")){
            varCode = varCode.split("\\(")[0];
        }
        if(BusinessKeyWardEnum.isBusinessKeyWard(varCode)){
            return true;
        }
        return false;
    }

    /**
     * 判断字符串是否是业务关键字
     * @return
     */
    public static boolean isJavsKeyWard(String varCode){
        if(varCode.contains("(")){
            varCode = varCode.split("\\(")[0];
        }
        if(JavsKeyWardEnum.isJavsKeyWard(varCode)){
            return true;
        }
        return false;
    }
}
